#ifndef HANDLEMEMBERCARD_H
#define HANDLEMEMBERCARD_H

#include <QDialog>
//#include "personmember.h"

class InquireSql;
class Calendar;
class SetMemberLevel;

enum LastClick {lineEditMemberCardNumber, lineEditMemberName, comboBoxGender,
               lineEditTel, lineEditEmail, lineEditAdress, lineEditHandleDate,
               comboBoxMemberLevel, lineEditIntegration, lineEditDiscount,
               lineEditMemberCardAmount, comboBoxStaffName, lineEditMemberPassword,
               lineEditConfirmPassword, lineEditCashPayment, lineEditCUPPayment,
               textEditRemark };

namespace Ui {
class HandleMemberCard;
}

class HandleMemberCard : public QDialog
{
    Q_OBJECT
    
public:
    explicit HandleMemberCard(QWidget *parent = 0);
    ~HandleMemberCard();
    void set_autoAddMemberCardNumber(QString autoAddMemberCardNumber)  {
        m_autoAddMemberCardNumber = autoAddMemberCardNumber;}
    void set_staffName();
    bool eventFilter(QObject *target, QEvent *event);

private slots:
    void on_pushButtonCancel_clicked();

    void on_pushButtonSave_clicked();

    void on_pushButtonAutoAddMemberCardNumber_clicked();

    void on_lineEditMemberCardAmount_editingFinished();

    void on_lineEditCashPayment_editingFinished();

    void on_lineEditCUPPayment_editingFinished();

    void on_lineEditIntegration_editingFinished();

    void on_lineEditDiscount_editingFinished();

    void slotUpdatelineEditHandleDate(QString);

    void on_pushButtonAddMemberLevel_clicked();

    void slotUpdateMemberLevel();

    void on_comboBoxMemberLevel_currentIndexChanged(int index);

private:
    void eliminationPushButtonBorder();
    void initMemberInformation();
    void initMemberLevel();
    QString completionPrice(const QString &);
    Ui::HandleMemberCard *ui;
    InquireSql *m_sql;
    QString m_autoAddMemberCardNumber;
    Calendar *m_calendar;
    SetMemberLevel *m_setMemberLevel;
    int m_lastClick;
};

#endif // HANDLEMEMBERCARD_H
